<?php if (!defined('SERVER_ROOT')) { exit('No direct script access allowed');}
$this->template->title = 'Hệ thống hỗ trợ công tác quản lý cán bộ trường ĐHTG';
$v_pop_win = isset($_REQUEST['pop_win']) ? '_pop_win' : '';
$this->template->display('dsp_header' . $v_pop_win . '.php');
//------------------------------------------------------------------------------
$MA_CAN_BO ='';
$TEN_HOC_KY = Session::get(TIEP_DAU_NGU_SESSION.'HOC_KY_HIEN_TAI');
$MA_LOAI_LOP_DAY='';
$MA_LOP_GIANG_DAY='';
$TEN_MON_HOC='';
$MA_NHOM_LOP_HOC='';
$SO_TIET='';
$SO_LUONG_SINH_VIEN='';
while ($arr = $arr_single_lopgiangday->FetchRow()){
    $MA_LOAI_LOP_DAY=$arr['MA_LOAI_LOP_DAY'];
    $TEN_HOC_KY=$arr['TEN_HOC_KY'];
    $MA_LOP_GIANG_DAY=$arr['MA_LOP_GIANG_DAY'];
    $TEN_MON_HOC=$arr['TEN_MON_HOC'];
    $MA_NHOM_LOP_HOC=$arr['MA_NHOM_LOP_HOC'];
    $SO_TIET=$arr['SO_TIET'];
    $SO_LUONG_SINH_VIEN=$arr['SO_LUONG_SINH_VIEN'];
}
?>
<form name="frmMain" method="post" id="frmMain" action=""><?php
    echo $this->hidden('controller', $this->get_controller_url());
    echo $this->hidden('hdn_dsp_single_method', 'dsp_single_lopgiangday');
    echo $this->hidden('hdn_dsp_all_method', 'dsp_all_lopgiangday');
    echo $this->hidden('hdn_update_method', 'update_lopgiangday');
    echo $this->hidden('hdn_delete_method', 'delete_lopgiangday');
    echo $this->hidden('hdn_item_id', $MA_LOP_GIANG_DAY);
    if ($MA_LOP_GIANG_DAY == '') {
         echo $this->hidden('hdn_update_type', 'THEM_MOI');
    }else{
         echo $this->hidden('hdn_update_type', 'CAP_NHAT');
    }
    echo $this->hidden('pop_win', $v_pop_win);
    ?>
    <h2 style="text-align: center">Cập nhật lớp giảng dạy</h2>
    <div class="Row">
        <div class="left-Col">Học kỳ <label class="required">(*)</label> </div>
        <div class="right-Col">
            <input type="text" name="txt_TEN_HOC_KY" id="txt_TEN_HOC_KY" value="<?php echo $TEN_HOC_KY; ?>"
                   class="inputbox" maxlength="255" style="width:95%"
                   onKeyDown="return handleEnter(this, event);"
                   data-allownull="no" data-validate="text"
                   data-name="học kỳ"
                   data-xml="no" data-doc="no"
                   readonly="readonly"
            />
        </div>
    </div>
    <div class="Row">
        <div class="left-Col">Loại lớp giảng dạy <label class="required">(*)</label></div>
        <div class="right-Col">
            <select id="cbx_MA_LOAI_LOP_DAY"  name="cbx_MA_LOAI_LOP_DAY" style="width:96%">
                  <?php while ($arr = $arr_all_loailopday->FetchRow()): ?>
                  <?php
                   $MA=$arr['MA_LOAI_LOP_DAY'];
                   $TEN=$arr['TEN_LOAI_LOP_DAY'];
                  ?>
                   <?php if($MA_LOAI_LOP_DAY == $MA):?>
                     <option value="<?php echo $MA; ?>" selected="selected"><?php echo $TEN; ?></option>
                  <?php else:?>
                     <option value="<?php echo $MA; ?>" ><?php echo $TEN; ?></option>
                  <?php endif ?>
        <?php endwhile; ?>
            </select>
        </div>
    </div>
    <div class="Row">
        <div class="left-Col">Số sinh viên<label class="required">(*)</label></div>
        <div class="right-Col">
             <input  type="text" name="txt_SO_LUONG_SINH_VIEN" id="txt_SO_LUONG_SINH_VIEN" value="<?php echo $SO_LUONG_SINH_VIEN; ?>"
                   class="inputbox" maxlength="255" style="width:95%"
                   onKeyDown="return handleEnter(this, event);"
                   data-allownull="no" data-validate="text"
                   data-name="số lượng sinh viên"
                   data-xml="no" data-doc="no"
            />
        </div>
    </div>
    <div class="Row">
        <div class="left-Col">Tên môn học <label class="required">(*)</label> </div>
        <div class="right-Col">
              <input  type="text" name="txt_TEN_MON_HOC" id="txt_TEN_MON_HOC" value="<?php echo $TEN_MON_HOC; ?>"
                   class="inputbox" maxlength="255" style="width:95%"
                   onKeyDown="return handleEnter(this, event);"
                   data-allownull="no" data-validate="text"
                   data-name="tên lớp giảng dạy"
                   data-xml="no" data-doc="no"
            />

        </div>
    </div>
     <div class="Row">
        <div class="left-Col">Mã nhóm/lớp <label class="required">(*)</label> </div>
        <div class="right-Col">
              <input  type="text" name="txt_MA_NHOM_LOP_HOC" id="txt_MA_NHOM_LOP_HOC" value="<?php echo $MA_NHOM_LOP_HOC; ?>"
                   class="inputbox" maxlength="255" style="width:95%"
                   onKeyDown="return handleEnter(this, event);"
                   data-allownull="no" data-validate="text"
                   data-name="mã nhóm lớp dạy"
                   data-xml="no" data-doc="no"
            />

        </div>
    </div>
     <div class="Row">
        <div class="left-Col">Số tiết<label class="required">(*)</label> </div>
        <div class="right-Col">
             <input  type="text" name="txt_SO_TIET" id="txt_SO_TIET" value="<?php echo $SO_TIET; ?>"
                   class="inputbox" maxlength="255" style="width:95%"
                   onKeyDown="return handleEnter(this, event);"
                   data-allownull="no" data-validate="text"
                   data-name="số tiết"
                   data-xml="no" data-doc="no"
            />
        </div>
    </div>

    <div class="button-area">
        <input type="button" name="update" class = 'button save' value="Cập nhật" onclick="btn_update_onclick();"/>
        <?php $v_back_action = ($v_pop_win === '') ? 'btn_back_onclick();' : 'try{window.parent.hidePopWin();}catch(e){window.close();};';?>
        <input type="button" name="cancel" class = 'button close' value="Bỏ qua" onclick="<?php echo $v_back_action;?>"/>
    </div>

</form>
<?php $this->template->display('dsp_footer' .$v_pop_win . '.php');